function ajaxPromise(ops){
	ops=ops||{};
	ops.method=ops.method||"get";
	ops.data=ops.data||{};
	let xhr=new XMLHttpRequest();
	let str="";
	for(var key in ops.data){
		str+=`${key}=${ops.data[key]}&`;
	}
	let t=new Date().getTime();
	ops.url=ops.method=="get"?ops.url+'?'+str+"w_t="+t:ops.url;
	xhr.open(ops.method,ops.url);
	if(ops.method=="post"){
		xhr.setRequestHeader("content-type","application/x-www-form-urlencoded");
		//str[str.lastIndexOf("&")]=""; //多一个&符放在send()里面依然没有问题！
		xhr.send(str);
	}else{
		xhr.send();
	}
	
	return new Promise(function(resolve,reject){
		xhr.onload=function(){
			if(xhr.status==200){
				resolve(xhr.responseText);
			}else{
				reject("您的错误是"+xhr.status);
			}
		}
	})
}